<?php
if (!defined("_INDEX")) { header("Location: /"); die; }

require_once ADMIN.DS."/head.php";
?>
<h1>Список сайтов-партнеров</h1><br />
<div class='floating'><a href='partners/add'>Добавить сайт</a></div>
<table cellpadding='0' cellspacing='0' class='list'>
	<tr class='table_header'>
		<td width='50px'>ID</td>
		<td width='200px'>Контакт</td>
		<td width='300px'>Сайт</td>
		<td width='200px' class="actions">Действия</td>
	</tr><?php
		$bp = $db->getTable("select * from `business_partners` order by `id`");
		foreach ($bp as $partner) {

			echo "<tr><td>{$partner['id']}</td>";
			echo "<td>{$partner['name']}<br /><a href='mailto:{$partner['e-mail']}'>{$partner['e-mail']}</a></td>";
			echo "<td>{$partner['site_name']}<br /><a href='{$partner['url']}'>{$partner['url']}</a></td>";
			echo "<td class='actions'><a href='partners/edit/{$partner['id']}' class='edit'>Редактировать</a> | <a href='partners/delete/{$partner['id']}' class='delete'>Удалить</a></td></tr>";
		}
?></table>

<?php require_once ADMIN.DS."/footer.php"; ?>